package org.gdsdxy.pmmp.web.action;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.gdsdxy.pmmp.dao.IUserManagerDao;
import org.gdsdxy.pmmp.service.IUserManagerService;
import org.gdsdxy.pmmp.service.UserManagerServiceImpl;

//����̳�ActionUserManagerServiceImpl
public class IndexAction extends Action{
 
	public IndexAction(){
		System.out.println("index Action creating");
	}
  private IUserManagerService service ;//=new UserManagerServiceImpl();

	

	public void setService(IUserManagerService service) {
		this.service = service;
		System.out.println("注入serice:"+service);
	}



	@Override
	public ActionForward execute(ActionMapping mapping, ActionForm form,
			HttpServletRequest req, HttpServletResponse response)
			throws Exception {
		System.out.println("注入："+service);
	  List lastestUsers = service.queryLatestUsers();
    req.setAttribute("lastestUsers", lastestUsers);
    return mapping.findForward("imgelist");
	}

}
